/**
 * Created by user on 2018/11/12.
 */

// use localStorage to store the authority info, which might be sent from server in actual project.
import { encryption, decryption } from '@/utils/Encrypt'
const LOCAL_KEY = 'auth_thinker_key'

const getAuthority = () => {
  let _ = localStorage.getItem(LOCAL_KEY) || encryption('')
  return decryption(_)
}

const setAuthority = (authority) => {
  return localStorage.setItem(LOCAL_KEY, encryption(authority))
}


export { setAuthority, getAuthority }
